package com.ccrfid.rmc6.service.business.chongqing;

import com.ccrfid.rmc6.appconfig.exception.pojo.AppException;
import com.ccrfid.rmc6.entity.business.chongqing.CQPatrolLocationEntity;
import com.ccrfid.rmc6.entity.business.chongqing.CQPatrolRecordEntity;
import com.ccrfid.rmc6.entity.business.chongqing.CQPatrolRoadEntity;
import com.ccrfid.rmc6.entity.poi.PoiLocationEntity;
import com.ccrfid.rmc6.repository.search.SearchCriteria;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface CQPatrolService {

    //分页查询巡更路线信息
    Page<CQPatrolRoadEntity> getCQPatrolRoadPage(SearchCriteria criteria, Pageable pageable);

    List<CQPatrolRoadEntity> getAllCQPatrolRoadList();

    //获取单个路线信息
    CQPatrolRoadEntity getCQPatrolRoadById(Long roadId);

    //新增路线信息
    CQPatrolRoadEntity createCQPatrolRoad(CQPatrolRoadEntity entity) throws AppException;

    //更新路线信息
    CQPatrolRoadEntity updateCQPatrolRoad(Long roadId, CQPatrolRoadEntity entity) throws AppException;

    //删除路线信息
    boolean deleteCQPatrolRoad(Long roadId) throws AppException;

    //获取可用于添加的巡更区域列表
    List<PoiLocationEntity> getFreePatrolLocationList();

    //获取某个路线的巡更区域列表
    List<CQPatrolLocationEntity> getCQPatrolLocationList(Long roadId);

    //为某个路线增加一个巡更区域
    CQPatrolLocationEntity createCQPatrolLocation(Long roadId, Long locationId) throws AppException;

    //为某个路线删除一个巡更区域
    boolean deleteCQPatrolLocation(Long roadId, Long locationId) throws AppException;

    //分页查询巡更记录信息
    Page<CQPatrolRecordEntity> getCQPatrolRecordPage(SearchCriteria criteria, Pageable pageable);

    CQPatrolRecordEntity saveCQPatrolRecord(CQPatrolRecordEntity entity);

    CQPatrolRecordEntity getPatrolRecordByRoadIdMax(Long roadId);

    List<CQPatrolRecordEntity> getAllPatrolRecordByTask(String task);
}
